<template>
  <ul class="module-attr-tab">
    <li
      v-for="item in tab"
      :class="{ 'on': value === item.type }"
      @click="changeTab(item.type)"
      :key="item.type"
    >
      {{ item.name }}
    </li>
  </ul>
</template>

<script>
export default {
  name: "attrTab",
  props: {
    value: {
      type: Number,
      default: 1,
    },
  },
  data() {
    return {
      tab: [
        { type: 1, name: "基础设置",},
        { type: 2, name: "样式设置" }
      ]
    };
  },
  methods: {
      changeTab(type) {
          if(type === this.value) return;
          this.$emit('input', type)
      }
  }
};
</script>

<style></style>
